package com.study.lession.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.study.lession.domain.LessionTeacherInfo;
import com.study.lession.domain.LessionUserInfo;
import com.study.lession.service.LessionTeacherInfoService;
import com.study.lession.service.LessionUserInfoService;

/**
 * 校验控制器
 * @author warm
 * @version 2019年07月11日
 */
@Controller
public class CheckController {
	
	@Autowired
	private LessionUserInfoService lessionUserInfoService;
	@Autowired
	private LessionTeacherInfoService lessionTeacherInfoService;
	/**
	 * 校验
	 * @param loginName
	 * @return
	 */
	@RequestMapping("/checkName")
	@ResponseBody
	public Object checkName(LessionUserInfo  queryVo) {
		List<LessionUserInfo> infos = lessionUserInfoService.queryLessionUserInfoList(queryVo);
		if(null == infos || infos.size() == 0) {
			return true;
		};
		return false;
	}
	
	/**
	 * 校验
	 * @param loginName
	 * @return
	 */
	@RequestMapping("/checkNameteacher")
	@ResponseBody
	public Object checkNameteacher(LessionTeacherInfo  queryVo) {
		List<LessionTeacherInfo> infos = lessionTeacherInfoService.queryLessionTeacherInfoList(queryVo);
		if(null == infos || infos.size() == 0) {
			return true;
		};
		return false;
	}
}
